from sys import stdin, stderr
import traceback

ignored = []

text = []

printWords = ["Flop", "turn", "river", "winners", "winner"]

for ord in stdin:
	text.append(ord)
	name = ord.split(':')
	if("folded" in ord):
		ignored.append(name[0])

betting = True

for ord in text:
	name = ord.split(':')
	
	if("Pocket cards" in ord):
		betting = False
	
	if("Cash" in ord):
		betting = True
		
	if("winners" in ord):
		betting = False  	
	
	if(not name[0] in ignored and not betting):	
		print (ord)
	
	if not name[0] in ignored:
		if "Flop" in ord or "turn" in ord or "river" in ord:
			print (ord)